"use strict"
let methods = {
	init_product() {
		
	},


	scaleFun(item,index){
		// var ele = document.querySelector('.colorBox'+index);
		// 获取元素相对于视口的位置和大小  
		// var rect = ele.getBoundingClientRect();  
		// // 获取元素相对于整个文档的位置  
		// var x = rect.left + window.pageXOffset;  
		// var y = rect.top + window.pageYOffset;  
		// console.log('元素的横坐标位置:', x);
		// console.log('元素的纵坐标位置:', y);
		if(item.flag){
			this.$refs.colorBox[index].style.width = "240px";
			this.$refs.colorBox[index].style.height = "240px";
			this.$refs.colorBox[index].style.transition = "1s";
			this.$refs.colorBox[index].style.borderRadius = "120px";
			this.$refs.colorBox[index].style.position = "relative";
			this.$refs.colorBox[index].style.zIndex = "0";
			this.$refs.colorBox[index].style.margin = " 26px auto";
		}else{
			this.$refs.colorBox[index].style.width = "100vw";
			this.$refs.colorBox[index].style.height = "100vh";
			this.$refs.colorBox[index].style.height = "100vh";
			this.$refs.colorBox[index].style.position = "fixed";
			this.$refs.colorBox[index].style.top = "0";
			this.$refs.colorBox[index].style.left = "0";
			this.$refs.colorBox[index].style.borderRadius = "0";
			this.$refs.colorBox[index].style.margin = "0";
			this.$refs.colorBox[index].style.zIndex = "999999999";
			this.$refs.colorBox[index].style.transition = "1s";
		}
		this.data[this.num][index].flag =  !this.data[this.num][index].flag
		// console.log(this.data[this.num][index]);
	},

	// 复制颜色
	copyFun(bg){
		const dom = document.createElement("input");
        dom.value = bg;
        document.body.appendChild(dom);
        dom.select();
        document.execCommand("copy");
        document.body.removeChild(dom);

		this.$message({
			showClose: true,
			message: '复制成功！',
			type: 'success'
		  });
	},

	handleSizeChange(val) {
        // console.log(`每页 ${val} 条`);
	},
	handleCurrentChange(val) {
		this.num = val-1
		document.documentElement.scrollTop = 0;
	}
}